﻿@model  EventPhotographModel
@{
    ViewBag.Title = "编辑活动照片";
    Layout = "~/Views/Shared/_Layout.cshtml";
    var user = ViewBag.User as User;
}

@section Direct{

    @if (user.IsAdministrator())
    {
        <div class="adr">
            <ul>
                <li>@Html.ActionLink("返回", "Detail", new { id = Model.Id })
                </li>
            </ul>
        </div>
    }
}
<section class="ec-add">
    <div class="form">
        @using (Html.BeginForm("UploadPhotograph", "Event", FormMethod.Post, new { enctype = "multipart/form-data" }))
        {          
            <div class="field-large">
                <div class="editor-label">@Html.LabelFor(model => model.Caption)</div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.Caption)
                </div>
            </div>
            <div class="field-large">
                <div class="editor-field">
                    <input name="tempFile" type="file" />
                    @Html.HiddenFor(model => model.Id)
                </div>
            </div>
            <div class="field-large">
                <div class="editor-label">
                </div>
                <div class="editor-field">
                    <input type="submit" value="保存" />
                </div>
            </div>
        }
        <div class="field">
            <div class="editor-field">
                <img alt=""  src="/Assets/Event/@(Model.Id)/@(Model).jpg" />
            </div>
        </div>
    </div>
</section>
